﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace bdtheque.data.interfaces
{
    public interface IRepository<T>
        where T : class
    {
        IEnumerable<T> GetAll();
        IEnumerable<T> GetAll(string includePath);
        IEnumerable<T> Find(Expression<Func<T, bool>> predicate);
        IEnumerable<T> Find(Expression<Func<T, bool>> predicate, string includePath);
        T FirstOrDefault(Expression<Func<T, bool>> predicate);        
        T FirstOrDefault(Expression<Func<T, bool>> predicate, string includePath);
        T SingleOrDefault(Expression<Func<T, bool>> predicate);
        T SingleOrDefault(Expression<Func<T, bool>> predicate, string includePath);
        void AddEntity(T entity);
        void RemoveEntity(T entity);
        void AttachEntity(T entity);
        void DetachEntity(T entity);
    }
}
